package com.link.base.base.errorcode.service;

import com.link.base.base.errorcode.dao.mybatis.mapper.ErrorCodeMapper;
import com.link.base.base.errorcode.model.ErrorCode;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.service.BasicServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 错误编码信息维护
 *
 * @author cuizhiyong
 * @date 2019/4/25 19:07
 */
@Service
public class ErrorCodeServiceImpl extends BasicServiceImpl<ErrorCode> implements ErrorCodeService {

    private static String LNK_ERROR_CODE_KEY = "LINKCRM_KEY_OF_ERROR_CODE_CACHE";

    @Resource
    private ErrorCodeMapper errorCodeMapper;

    @Override
    public BasicMapper<ErrorCode> getBasicMapper() {
        return errorCodeMapper;
    }


    @Override
    public boolean duplicateValidate(ErrorCode errorCode) {
        return errorCodeMapper.duplicateValidate(errorCode) > 0;
    }

}
